package com.hson.demo.web.base.controller.hello;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hson.demo.base.app.ApiModel;
import com.hson.demo.soa.remote.TestServiceRemote;
import com.hson.demo.web.base.controller.AbstractController;

/**
 * 测试dubbo用的controller, testServiceRemote的服务存放于dubbo中。
 * @author:chenhs E-mail:hson08_chen@163.com
 * Created on 2017年5月26日 下午4:47:03
 */
@SuppressWarnings("rawtypes")
//@Controller
public class TestController extends AbstractController {

	@Autowired
//	@HessianClient("soa")
	private TestServiceRemote remote;
	
	
	@RequestMapping
	@ResponseBody
	public ApiModel yes(){
		try {
			return buildSuccMsg(remote.hello("jimmy.Yang+++++"));
		} catch (Exception e) {
			return buildErrorMsg(e, EXCEPTION, e.getMessage());
		}
	}
}
